package com.example.backend.service;

import com.example.backend.mapper.GoodsTypeMapper;
import com.example.backend.model.GoodsType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class GoodsTypeService {
    @Autowired
    GoodsTypeMapper mapper;

    public List<GoodsType> findAll() {
        return mapper.findAll();
    }

    public GoodsType findOne(int id) { return mapper.findOne(id);}
    @Transactional
    public int insertOne(GoodsType goodsType) {
        return mapper.insertOne(goodsType);
    }

    @Transactional
    public int updateOne(GoodsType goodsType) {
        return mapper.updateOne(goodsType);
    }

    @Transactional
    public int deleteOne(int id) {
        return mapper.deleteOne(id);
    }
}
